package com.adxon.servlet;

import com.adxon.cookie.Badge;
import com.adxon.cookie.Station;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.*;

@SuppressWarnings("serial")
public class SignoutServlet extends ServletBase{
	public void doGet(HttpServletRequest req,HttpServletResponse resp)
			throws IOException,ServletException{
		//Kooky.getAll(req);
		Station s=Station.get(req);
		if(s!=null){
			s.setOwner(null);
			s.addTo(resp);
			Badge b=new Badge();
			b.setOwner(null);
			b.addTo(resp);
		}
		if(req.getParameter("jump")==null)
			resp.sendRedirect("/");
		else{
			resp.setContentType("text/plain");
			print(resp,"Ok");
		}
	}
	public void doPost(HttpServletRequest req,HttpServletResponse resp)
			throws IOException,ServletException{
		doGet(req,resp);
	}
}